package com.nondo.dean.product.mapper;

import com.nondo.dean.product.domain.ProductAttach;
import com.nondo.dean.product.domain.ProductAttachExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.session.RowBounds;
import org.apache.ibatis.type.JdbcType;

public interface ProductAttachMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table product_attach
     *
     * @mbg.generated Mon Jun 25 11:55:32 CST 2018
     */
    @SelectProvider(type=ProductAttachSqlProvider.class, method="countByExample")
    long countByExample(ProductAttachExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table product_attach
     *
     * @mbg.generated Mon Jun 25 11:55:32 CST 2018
     */
    @DeleteProvider(type=ProductAttachSqlProvider.class, method="deleteByExample")
    int deleteByExample(ProductAttachExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table product_attach
     *
     * @mbg.generated Mon Jun 25 11:55:32 CST 2018
     */
    @Delete({
        "delete from product_attach",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table product_attach
     *
     * @mbg.generated Mon Jun 25 11:55:32 CST 2018
     */
    @Insert({
        "insert into product_attach (id, product_id, ",
        "attach_id, order_num, ",
        "create_by, create_date, ",
        "update_by, update_date, ",
        "remarks, del_flag)",
        "values (#{id,jdbcType=INTEGER}, #{productId,jdbcType=INTEGER}, ",
        "#{attachId,jdbcType=INTEGER}, #{orderNum,jdbcType=INTEGER}, ",
        "#{createBy,jdbcType=BIGINT}, #{createDate,jdbcType=TIMESTAMP}, ",
        "#{updateBy,jdbcType=BIGINT}, #{updateDate,jdbcType=TIMESTAMP}, ",
        "#{remarks,jdbcType=VARCHAR}, #{delFlag,jdbcType=CHAR})"
    })
    int insert(ProductAttach record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table product_attach
     *
     * @mbg.generated Mon Jun 25 11:55:32 CST 2018
     */
    @InsertProvider(type=ProductAttachSqlProvider.class, method="insertSelective")
    int insertSelective(ProductAttach record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table product_attach
     *
     * @mbg.generated Mon Jun 25 11:55:32 CST 2018
     */
    @SelectProvider(type=ProductAttachSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="product_id", property="productId", jdbcType=JdbcType.INTEGER),
        @Result(column="attach_id", property="attachId", jdbcType=JdbcType.INTEGER),
        @Result(column="order_num", property="orderNum", jdbcType=JdbcType.INTEGER),
        @Result(column="create_by", property="createBy", jdbcType=JdbcType.BIGINT),
        @Result(column="create_date", property="createDate", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="update_by", property="updateBy", jdbcType=JdbcType.BIGINT),
        @Result(column="update_date", property="updateDate", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="remarks", property="remarks", jdbcType=JdbcType.VARCHAR),
        @Result(column="del_flag", property="delFlag", jdbcType=JdbcType.CHAR)
    })
    List<ProductAttach> selectByExampleWithRowbounds(ProductAttachExample example, RowBounds rowBounds);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table product_attach
     *
     * @mbg.generated Mon Jun 25 11:55:32 CST 2018
     */
    @SelectProvider(type=ProductAttachSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="product_id", property="productId", jdbcType=JdbcType.INTEGER),
        @Result(column="attach_id", property="attachId", jdbcType=JdbcType.INTEGER),
        @Result(column="order_num", property="orderNum", jdbcType=JdbcType.INTEGER),
        @Result(column="create_by", property="createBy", jdbcType=JdbcType.BIGINT),
        @Result(column="create_date", property="createDate", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="update_by", property="updateBy", jdbcType=JdbcType.BIGINT),
        @Result(column="update_date", property="updateDate", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="remarks", property="remarks", jdbcType=JdbcType.VARCHAR),
        @Result(column="del_flag", property="delFlag", jdbcType=JdbcType.CHAR)
    })
    List<ProductAttach> selectByExample(ProductAttachExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table product_attach
     *
     * @mbg.generated Mon Jun 25 11:55:32 CST 2018
     */
    @Select({
        "select",
        "id, product_id, attach_id, order_num, create_by, create_date, update_by, update_date, ",
        "remarks, del_flag",
        "from product_attach",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="product_id", property="productId", jdbcType=JdbcType.INTEGER),
        @Result(column="attach_id", property="attachId", jdbcType=JdbcType.INTEGER),
        @Result(column="order_num", property="orderNum", jdbcType=JdbcType.INTEGER),
        @Result(column="create_by", property="createBy", jdbcType=JdbcType.BIGINT),
        @Result(column="create_date", property="createDate", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="update_by", property="updateBy", jdbcType=JdbcType.BIGINT),
        @Result(column="update_date", property="updateDate", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="remarks", property="remarks", jdbcType=JdbcType.VARCHAR),
        @Result(column="del_flag", property="delFlag", jdbcType=JdbcType.CHAR)
    })
    ProductAttach selectByPrimaryKey(Integer id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table product_attach
     *
     * @mbg.generated Mon Jun 25 11:55:32 CST 2018
     */
    @UpdateProvider(type=ProductAttachSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") ProductAttach record, @Param("example") ProductAttachExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table product_attach
     *
     * @mbg.generated Mon Jun 25 11:55:32 CST 2018
     */
    @UpdateProvider(type=ProductAttachSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") ProductAttach record, @Param("example") ProductAttachExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table product_attach
     *
     * @mbg.generated Mon Jun 25 11:55:32 CST 2018
     */
    @UpdateProvider(type=ProductAttachSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(ProductAttach record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table product_attach
     *
     * @mbg.generated Mon Jun 25 11:55:32 CST 2018
     */
    @Update({
        "update product_attach",
        "set product_id = #{productId,jdbcType=INTEGER},",
          "attach_id = #{attachId,jdbcType=INTEGER},",
          "order_num = #{orderNum,jdbcType=INTEGER},",
          "create_by = #{createBy,jdbcType=BIGINT},",
          "create_date = #{createDate,jdbcType=TIMESTAMP},",
          "update_by = #{updateBy,jdbcType=BIGINT},",
          "update_date = #{updateDate,jdbcType=TIMESTAMP},",
          "remarks = #{remarks,jdbcType=VARCHAR},",
          "del_flag = #{delFlag,jdbcType=CHAR}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(ProductAttach record);
}